package com.hunny.builder.one;

import lombok.Data;

/**
 * 人
 *
 * @author Create By Cb
 * @since 2022/4/24 15:59
 */
@Data
public class Student {

    private String name;

    private String sex;

    private int age;

    private String phone;

    private String email;

    public static class Builder {

        private final Student student;

        public Builder() {
            this.student = new Student();
        }

        public static Builder newBuilder() {
            return new Builder();
        }

        public Builder setName(String name) {
            this.student.setName(name);
            return this;
        }

        public Builder setSex(String sex) {
            this.student.setSex(sex);
            return this;
        }

        public Builder setAge(int age) {
            this.student.setAge(age);
            return this;
        }

        public Builder setPhone(String phone) {
            this.student.phone = phone;
            return this;
        }

        public Builder setEmail(String email) {
            this.student.setEmail(email);
            return this;
        }

        public Student build() {
            return this.student;
        }
    }
}